package demiChat;

import java.util.ArrayList;

import dataBase.DBManager;

public class DemiChatModule {
	public DBManager dbManager;
	public DemiChatModule()
	{
		dbManager =DBManager.getDbm();
	}

	public boolean writeChat(String text,String userId,String roomId)
	{
		dbManager.excuteUpdate("insert into chatTable(chatUserId,chatData,chatRoomId) " +
				"values('"+userId+"','"+text+"',"+roomId+")");
		return true;
	}
	public ArrayList getChatList()
	{
		ArrayList returnList=null;
		
		returnList =dbManager.getQueryDataArayList("select * from chatTable");
		
		return returnList;
	}
}
